package server;

import java.util.ArrayList;
import java.util.List;

public class Mapper {
//监听端口
    private int port = 8080;
    private List<Host> hosts = new ArrayList<>();

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public List<Host> getHosts() {
        return hosts;
    }

    public void setHosts(List<Host> hosts) {
        this.hosts = hosts;
    }
}
    class Host {
        private String name;

        private String appBase;

        private List<Context> contexts;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAppBase() {
            return appBase;
        }

        public void setAppBase(String appBase) {
            this.appBase = appBase;
        }

        public List<Context> getContexts() {
            return contexts;
        }

        public void setContexts(List<Context> contexts) {
            this.contexts = contexts;
        }
    }

    class Context{
        private String applicationName;

        private List<Wrapper> wrappers;

        private String applicationPath;

        public String getApplicationPath() {
            return applicationPath;
        }

        public void setApplicationPath(String applicationPath) {
            this.applicationPath = applicationPath;
        }

        public String getApplicationName() {
            return applicationName;
        }

        public void setApplicationName(String applicationName) {
            this.applicationName = applicationName;
        }

        public List<Wrapper> getWrappers() {
            return wrappers;
        }

        public void setWrappers(List<Wrapper> wrappers) {
            this.wrappers = wrappers;
        }
    }

    class Wrapper{
        private HttpServlet httpServlet;

        private String url;

        public Wrapper(HttpServlet httpServlet, String url) {
            this.httpServlet = httpServlet;
            this.url = url;
        }

        public HttpServlet getHttpServlet() {
            return httpServlet;
        }

        public void setHttpServlet(HttpServlet httpServlet) {
            this.httpServlet = httpServlet;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }
